import { Controller } from "../../mvc/core/Controller";
import { NetDispatcher } from "../../mvc/core/NetDispatcher";
import { EGateCommand } from "../../../Message/Command/EGateCommand";
import { EPublicCommand } from "../../../Message/Command/EPublicCommand";
import { ServerCommand } from "../mvc/ServerCommand";
import { RolePlayer } from "../scene/player/entity/RolePlayer";
import { PlayerEvent } from "../scene/events/PlayerEvent";
import { Dispatcher } from "../../mvc/core/Dispatcher";
import { EventName } from "../mvc/EventName";
import { ISeriesLoginRewardWindow } from "../../../modules/interfaces/ISeriesLoginRewardWindow";
import { SeriesLoginRewardWindow } from "../view/daily/seriesLogin/SeriesLoginRewardWindow";
import { IView } from "../../mvc/interfaces/IView";
import { DailyModule } from "../../../modules/DailyModule";
import { WindowEvent } from "../../component/window/WindowEvent";
import { DailyIconSwf } from "../view/daily/DailyIconSwf";
import { DataEvent } from "../events/DataEvent";
import { MessageBlock } from "../../../Framework/MQ/MessageBlock";
import { GameProxy } from "../mvc/GameProxy";
import { IDailyModule } from "../../../modules/interfaces/IDailyModule";
import { DailyInfo } from "../model/DailyInfo";
import { DailyRule } from "../rules/DailyRule";
import { EActivityType } from "../../../Message/Public/EActivityType";
import { ECategory } from "../../../Message/Public/ECategory";
import { EProp } from "../../../Message/Public/EProp";
import { Alert } from "../../../com/mui/controls/Alert";
import { Language } from "../../../extend/language/Language";
import { GameController } from "../mvc/GameController";
import { BrowerUtil } from "../../../com/gengine/utils/BrowerUtil";
import { ParamsConst } from "../../common/global/ParamsConst";
import { LocalCacheSetWindow } from "../view/walkthrough/LocalCacheSetWindow";
import { GameManager } from "../manager/GameManager";
import { KeyCode } from "../../../com/gengine/keyBoard/KeyCode";
import { MsgManager } from "../manager/MsgManager";
import { AIManager } from "../scene/ai/AIManager";
import { AIType } from "../scene/ai/AIType";
import { SAttribute } from "../../../Message/Public/SAttribute";
import { SPlayerActivity } from "../../../Message/Game/SPlayerActivity";
import { SDailyWelfare } from "../../../Message/Public/SDailyWelfare";
import { HTMLUtil } from "../../../com/gengine/utils/HTMLUtil";
import { ItemData } from "../resource/info/ItemData";
import { DailyType } from "../rules/DailyType";
import { EDailyWelfare } from "../../../Message/Public/EDailyWelfare";
import { ENpcEffect } from "../../../Message/Public/ENpcEffect";
import { GameMapUtil } from "../scene/map/GameMapUtil";
type int = number;
//class DailyController
    
    export  class DailyController extends Controller
    {
       

        protected /* override */ initServer(): void
        {
            super.initServer();
            NetDispatcher.addCmdListener(EGateCommand._ECmdGatePlayerTransport, this.onPlayerTransportRes);
            NetDispatcher.addCmdListener(EGateCommand._ECmdGatePlayerLoopBook, this.onPlayerLoopBookRes);
            NetDispatcher.addCmdListener(EPublicCommand._ECmdPublicRunBusinessPlayer, this.onRunBussinessRes);
            NetDispatcher.addCmdListener(EGateCommand._ECmdGateServerOpenDate, this.onServerOpenDateRes);
            NetDispatcher.addCmdListener(EGateCommand._ECmdGatePromotionCardInfo, this.onPromotionCardInfoRes);
            NetDispatcher.addCmdListener(EGateCommand._ECmdGatePlayerTreasureHunt, this.onTreasureHuntRes);
            NetDispatcher.addCmdListener(EGateCommand._ECmdGatePlayerGuildTask, this.onGuildTaskRes);
            NetDispatcher.addCmdListener(EGateCommand._ECmdGatePlayerKillEvil, this.onEvilTaskRes);
            NetDispatcher.addCmdListener(EGateCommand._ECmdGatePlayerSchoolTask, this.onSchoolTaskRes);
            NetDispatcher.addCmdListener(EGateCommand._ECmdGatePlayerCycleTask, this.onCycleTaskRes);
            NetDispatcher.addCmdListener(EGateCommand._ECmdGateActivityActive, this.onActiveActiveRes);
            NetDispatcher.addCmdListener(ServerCommand.GetOfflineTimeSuccess, this.onGetTimeSuccessHandler);
            RolePlayer.instance.addEventListener(PlayerEvent.RoleLevelUpdate, this.onRoleLevelUpdate);
            Dispatcher.addEventListener(EventName.DailyActiveFlyTo, this.onDailyActiveFlyToHandler);
            Dispatcher.addEventListener(EventName.DailyActiveGoTo, this.onDailyActiveGoToHandler);
            Dispatcher.addEventListener(EventName.SeriesLoginClearDay, this.onSeriesLoginClearDayHandler);
            Dispatcher.addEventListener(EventName.SeriesLoginGainReward, this.onSeriesLoginGainRewardHandler);
            Dispatcher.addEventListener(EventName.SeriesLoginLookupReward, this.onSeriesLoginLookupRewardHandler);
            NetDispatcher.addCmdListener(EGateCommand._ECmdGateContinuousLoad, this.onContinuousLoadHandler);
            NetDispatcher.addCmdListener(EGateCommand._ECmdGateActivity, this.onActivityRes);
            NetDispatcher.addCmdListener(EGateCommand._ECmdGateDailyWelfare, this.onDailyWelfareRes);
            Dispatcher.addEventListener(EventName.DailyDegreeGetReward, this.onDegreeGetRewardReq);
            Dispatcher.addEventListener(EventName.DailyDegreeGetRewardTotal, this.onDegreeGetRewardTotalReq);
            Dispatcher.addEventListener(EventName.DailyDegreeGetRewardRes, this.onDegreeGetRewardRes);
            Dispatcher.addEventListener(EventName.DailyDegreeGetRewardTotalRes, this.onDegreeGetRewardTotalRes);
            Dispatcher.addEventListener(EventName.DailyCopyMarkReward, this.onGetCopyMarkRewardRes);
            NetDispatcher.addCmdListener(ServerCommand.Copy_CopyNumInfoChange, this.onCopyNumInfoChange);
            Dispatcher.addEventListener(EventName.DailyBossRefreshListReq, this.onBossRefreshListReqHandler);
            Dispatcher.addEventListener(EventName.DailyBossRefreshListRes, this.onBossRefreshListResHandler);
            Dispatcher.addEventListener(EventName.DailyTabOpenByType, this.onDailyTabOpenByTypeHandler);
            Dispatcher.addEventListener(EventName.ServerOpenDay, this.onServerOpenDayRes);
            Dispatcher.addEventListener(EventName.HavePay, this.onHavePayHandler);
            Dispatcher.addEventListener(EventName.DailyActiveTimeReq, this.onDailyActiveTimeReq);
            Dispatcher.addEventListener(EventName.DailyActiveTimeRes, this.onDailyActiveTimeRes);
            Dispatcher.addEventListener(EventName.LGXBDicCountChange, this.onLGXBCountChangeHandler);
            Dispatcher.addEventListener(EventName.DailyCheckEveryDayActive, this.onCheckEveryDayActiveHandler);
            Dispatcher.addEventListener(EventName.DailyEveryDayActiveOpt, this.onEveryDayActiveOptHandler);
            NetDispatcher.addCmdListener(ServerCommand.RoleNewEnergyUpdate, this.onRoleNewEnergyUpdate);
            return;
        }

        /* internal  */get seriesLoginReward(): ISeriesLoginRewardWindow
        {
            if (!this._seriesLoginReward) 
            {
                this._seriesLoginReward = new SeriesLoginRewardWindow();
            }
            return this._seriesLoginReward;
        }

        protected /* override */ initView(): IView
        {
            var loc1=new DailyModule();
            loc1.addEventListener(WindowEvent.SHOW, this.onDailyModuleShow);
            return loc1;
        }

        /* internal  */showOrHideGiftIcon(): void
        {
            if (!cache.role.entityInfo) 
            {
                return;
            }
            if (cache.role.entityInfo.level >= 2 && cache.role.entityInfo.level <= 100 && cache.daily.serverOpenDay <= 5 && cache.role.recharge < 1) 
            {
                if (!this._dailySwf) 
                {
                    this._dailySwf = DailyIconSwf.getInstance();
                }
                if (this._dailySwf.isHide) 
                {
                    this._dailySwf.show();
                }
            }
            else if (this._dailySwf) 
            {
                if (!this._dailySwf.isHide) 
                {
                    this._dailySwf.hide();
                }
            }
            return;
        }

        /* internal  */onServerOpenDayRes(arg1: DataEvent): void
        {
            this.showOrHideGiftIcon();
            return;
        }

        /* internal  */onHavePayHandler(arg1: DataEvent): void
        {
            if (this._dailySwf && cache.role.recharge >= 1 && cache.daily.serverOpenDay <= 5) 
            {
                if (!this._dailySwf.isHide) 
                {
                    this._dailySwf.hide();
                }
                Dispatcher.dispatchEvent(new DataEvent(EventName.FirstRechargeTips));
            }
            return;
        }

        /* internal  */onPlayerTransportRes(arg1: MessageBlock): void
        {
            GameProxy.daily.onPlayerTransportRes(arg1);
            GameProxy.taskProxy.updateReachLevelTask();
            return;
        }

        /* internal  */onPlayerLoopBookRes(arg1: MessageBlock): void
        {
            GameProxy.daily.onPlayerLoopBookRes(arg1);
            GameProxy.taskProxy.addCycleTask();
            GameProxy.taskProxy.updateReachLevelTask();
            return;
        }

        /* internal  */onRunBussinessRes(arg1: MessageBlock): void
        {
            GameProxy.daily.onPlayerRunBussinessRes(arg1);
            GameProxy.taskProxy.updateReachLevelTask();
            return;
        }

        /* internal  */onTreasureHuntRes(arg1: MessageBlock): void
        {
            GameProxy.daily.onTreasureHuntRes(arg1);
            GameProxy.taskProxy.updateReachLevelTask();
            return;
        }

        /* internal  */onGuildTaskRes(arg1: MessageBlock): void
        {
            GameProxy.daily.onGuildTaskRes(arg1);
            GameProxy.taskProxy.updateReachLevelTask();
            return;
        }

        /* internal  */onEvilTaskRes(arg1: MessageBlock): void
        {
            GameProxy.daily.onEvilTaskRes(arg1);
            GameProxy.taskProxy.addEvilTask();
            GameProxy.taskProxy.updateReachLevelTask();
            return;
        }

        /* internal  */onSchoolTaskRes(arg1: MessageBlock): void
        {
            GameProxy.daily.onSchoolTaskRes(arg1);
            GameProxy.taskProxy.addSchoolTask();
            GameProxy.taskProxy.updateReachLevelTask();
            return;
        }

        /* internal  */onCycleTaskRes(arg1: MessageBlock): void
        {
            GameProxy.daily.onCycleTaskRes(arg1);
            GameProxy.taskProxy.updateReachLevelTask();
            return;
        }

        /* internal  */onActiveActiveRes(arg1: MessageBlock): void
        {
            GameProxy.daily.onActiveActiveRes(arg1);
            if (_view && !_view.isHide) 
            {
                (_view as IDailyModule).onActiveActiveRes(cache.daily.activeActive.hadReward, cache.daily.activeActive.minFinishDegree);
            }
            return;
        }

        /* internal  */onServerOpenDateRes(arg1: MessageBlock): void
        {
            GameProxy.daily.onServerOpenDateRes(arg1);
            Dispatcher.dispatchEvent(new DataEvent(EventName.ServerOpenDay, cache.daily.serverOpenDay));
            return;
        }

        /* internal  */onPromotionCardInfoRes(arg1: MessageBlock): void
        {
            GameProxy.daily.onPromotionCardInfoRes(arg1);
            Dispatcher.dispatchEvent(new DataEvent(EventName.DailyGiftInfoRes));
            return;
        }

        /* internal  */onGetTimeSuccessHandler(arg1: Object): void
        {
            cache.daily.offLineTime = int(arg1.time);
            cache.daily.offLineExp = Number(arg1.exp);
            return;
        }

        /* internal  */onRoleLevelUpdate(arg1: Object): void
        {
            GameProxy.taskProxy.updateReachLevelTask();
            if (_view && !_view.isHide) 
            {
                (view as IDailyModule).updateDegreeList();
                (view as IDailyModule).updateDegreeReward();
                (view as IDailyModule).updateDailyList();
            }
            this.showOrHideGiftIcon();
            return;
        }

        /* internal  */onDailyActiveGoToHandler(arg1: DataEvent): void
        {
            this.dailyActiveGoTo(arg1.data as DailyInfo);
            return;
        }

        /* internal  */dailyActiveGoTo(arg1: DailyInfo): void
        {
            var loc1=null;
            if (arg1 != null) 
            {
                var loc2=arg1.type;
                switch (loc2) 
                {
                    case DailyRule.CycleTask: case EActivityType._EActivityTypeLoopTask:
                    {
                        loc1 = cache.pack.backPackCache.getTypeItems(ECategory._ECategoryProp, EProp._EPropTaskLoopBook);
                        if (loc1.length <= 0) 
                        {
                            Alert.show(Language.getString(20047));
                        }
                        else 
                        {
                            Dispatcher.dispatchEvent(new DataEvent(EventName.UseTaskFlushLoopBook));
                        }
                        break;
                    }
                    case DailyRule.TestField: case EActivityType._EActivityTypeBattleField:
                    {
                        Dispatcher.dispatchEvent(new DataEvent(EventName.BattlefieldShowIntroduce));
                        break;
                    }
                    case DailyRule.Question:
                    {
                        Dispatcher.dispatchEvent(new DataEvent(EventName.QuestionWindowOpen));
                        break;
                    }
                    case DailyRule.EquipOpt:
                    {
                        GameController.equipment.view.show();
                        break;
                    }
                    case DailyRule.PetOpt:
                    {
                        Dispatcher.dispatchEvent(new DataEvent(EventName.PetOpenWindow, 2));
                        break;
                    }
                    case DailyRule.Fish:
                    {
                        Dispatcher.dispatchEvent(new DataEvent(EventName.FishGotoFish));
                        break;
                    }
                    case DailyRule.BrowsetCacheSet:
                    {
                        BrowerUtil.getUrl(ParamsConst.instance.cacheSetUrl);
                        break;
                    }
                    case DailyRule.LocalCacheSet:
                    {
                        LocalCacheSetWindow.instance.show();
                        break;
                    }
                    case DailyRule.Screen:
                    {
                        GameManager.instance.popupWindow(KeyCode.F9);
                        MsgManager.showRollTipsMsg(Language.getString(20048));
                        break;
                    }
                    case DailyRule.SetShowNum:
                    {
                        GameController.systemSetting.view.show();
                        Dispatcher.dispatchEvent(new DataEvent(EventName.Guide_PlayerNumSet));
                        break;
                    }
                    default:
                    {
                        AIManager.onAutoPathAIControl(arg1.target);
                    }
                }
            }
            return;
        }

        /* internal  */onDailyActiveFlyToHandler(arg1: DataEvent): void
        {
            this.dailyActiveFlyTo(arg1.data as DailyInfo);
            return;
        }

        /* internal  */dailyActiveFlyTo(arg1: DailyInfo): void
        {
            var loc1=null;
            if (arg1 != null) 
            {
                var loc2=arg1.type;
                switch (loc2) 
                {
                    case DailyRule.CycleTask:
                    {
                        loc1 = cache.pack.backPackCache.getTypeItems(ECategory._ECategoryProp, EProp._EPropTaskLoopBook);
                        if (loc1.length <= 0) 
                        {
                            Alert.show(Language.getString(20047));
                        }
                        else 
                        {
                            Dispatcher.dispatchEvent(new DataEvent(EventName.UseTaskFlushLoopBook));
                        }
                        break;
                    }
                    default:
                    {
                        AIManager.onAIControl(arg1.target, AIType.AI_Convey);
                    }
                }
            }
            return;
        }

        /* internal  */onContinuousLoadHandler(arg1: MessageBlock): void
        {
            var loc1=arg1.messageBase as SAttribute;
            cache.daily.sAttribute = loc1;
            return;
        }

        /* internal  */onActivityRes(arg1: MessageBlock): void
        {
            var loc1=arg1.messageBase as SPlayerActivity;
            cache.daily.updateDegreeInfo(loc1);
            Dispatcher.dispatchEvent(new DataEvent(EventName.DailyDegreeUpdate));
            if (_view && !_view.isHide) 
            {
                (_view as IDailyModule).updateDegreeList();
            }
            return;
        }

        /* internal  */onDailyWelfareRes(arg1: MessageBlock): void
        {
            var loc1=arg1.messageBase as SDailyWelfare;
            cache.daily.updateDailyWelfare(loc1);
            if (_view && !_view.isHide) 
            {
                (_view as IDailyModule).updateDailyWelfare();
            }
            return;
        }

        /* internal  */onDegreeGetRewardReq(arg1: DataEvent): void
        {
            if (cache.daily.totalProcess <= 0) 
            {
                Alert.show(Language.getStringByParam(20049, HTMLUtil.addColor("0%", "#ff0000")), Language.getString(20055), Alert.OK);
                return;
            }
            var loc1=arg1.data as DailyInfo;
            GameProxy.daily.degreeGetRewardReq(loc1.type);
            return;
        }

        /* internal  */onDegreeGetRewardTotalReq(arg1: DataEvent): void
        {
            if (arg1.data) 
            {
                GameProxy.daily.degreeGetRewardActiveReq();
            }
            else 
            {
                if (cache.daily.totalProcess <= 0) 
                {
                    Alert.show(Language.getStringByParam(20049, HTMLUtil.addColor("0%", "#ff0000")), Language.getString(20055), Alert.OK);
                    return;
                }
                GameProxy.daily.degreeGetRewardTotalReq();
            }
            return;
        }

        /* internal  */onDegreeGetRewardRes(arg1: DataEvent): void
        {
            var loc1=arg1.data as Array<any>;
            if (loc1 && loc1.length > 0) 
            {
                (view as IDailyModule).onDegreeGetRewardRes(loc1);
            }
            return;
        }

        /* internal  */onDegreeGetRewardTotalRes(arg1: DataEvent): void
        {
            var loc1=arg1.data as Array<any>;
            if (loc1 && loc1.length > 0) 
            {
                (view as IDailyModule).onDegreeGetRewardRes(loc1);
            }
            return;
        }

        /* internal  */onSeriesLoginClearDayHandler(arg1: DataEvent): void
        {
            GameProxy.roleProxy.clearContinuousLoad();
            return;
        }

        /* internal  */onSeriesLoginGainRewardHandler(arg1: DataEvent): void
        {
            var loc1=arg1.data as int;
            GameProxy.roleProxy.getContinuousLoadReward(loc1);
            return;
        }

        /* internal  */onSeriesLoginLookupRewardHandler(arg1: DataEvent): void
        {
            this.seriesLoginReward.show();
            return;
        }

        /* internal  */onCopyNumInfoChange(arg1: Object): void
        {
            cache.daily.updateCopyExp();
            if (_view && !_view.isHide) 
            {
                (_view as IDailyModule).updateCopyGradeList();
                (_view as IDailyModule).updateDailyWelfare();
            }
            GameProxy.taskProxy.updateReachLevelTask();
            return;
        }

        /* internal  */onGetCopyMarkRewardRes(arg1: DataEvent): void
        {
            if (_view && !view.isHide) 
            {
                (_view as IDailyModule).onGetCopyMarkRewardsRes(arg1.data as ItemData);
            }
            return;
        }

        public showLoginNotice(): void
        {
            view.show();
            (view as IDailyModule).showLoginNotice();
            return;
        }

        /* internal  */onBossRefreshListReqHandler(arg1: DataEvent): void
        {
            GameProxy.daily.bossRefreshListReq();
            return;
        }

        /* internal  */onBossRefreshListResHandler(arg1: DataEvent): void
        {
            var loc1=arg1.data as Array<any>;
            cache.daily.onBossRefreshListUpdate(loc1);
            if (_view && !_view.isHide) 
            {
                (view as IDailyModule).onBossRefreshRes(loc1);
            }
            return;
        }

        /* internal  */onDailyTabOpenByTypeHandler(arg1: DataEvent): void
        {
            var loc1=0;
            var loc2=0;
            if (view.isHide) 
            {
                view.show();
            }
            else 
            {
                view.layer.setTop(view as Object /* flash.display.DisplayObject */);
            }
            if (arg1.data && arg1.data is DailyType) 
            {
                loc1 = (arg1.data as DailyType).supType;
                loc2 = (arg1.data as DailyType).subType;
            }
            else 
            {
                loc1 = DailyRule.TypeDegree;
                loc2 = 0;
            }
            (view as IDailyModule).openTabByType(loc1, loc2);
            return;
        }

        /* internal  */onDailyModuleShow(arg1: WindowEvent): void
        {
            if (cache.guide.guideCopyMarkReward > 0) 
            {
                Dispatcher.dispatchEvent(new DataEvent(EventName.DailyTabOpenByType, new DailyType(DailyRule.TypeCopyGrade, cache.guide.guideCopyMarkReward)));
                cache.guide.guideCopyMarkReward = 0;
            }
            return;
        }

        /* internal  */onDailyActiveTimeReq(arg1: DataEvent): void
        {
            GameProxy.daily.dailyActiveTimeReq();
            return;
        }

        /* internal  */onDailyActiveTimeRes(arg1: DataEvent): void
        {
            if (_view && !_view.isHide) 
            {
                (_view as IDailyModule).onDailyActiveTimeRes(arg1.data as Map<any, any> /* flash.utils.Dictionary */);
            }
            return;
        }

        /* internal  */onLGXBCountChangeHandler(arg1: DataEvent): void
        {
            if (_view && !_view.isHide) 
            {
                (view as IDailyModule).updateDailyList();
            }
            return;
        }

        /* internal  */onCheckEveryDayActiveHandler(arg1: DataEvent): void
        {
            if (_view && !_view.isHide) 
            {
                (view as IDailyModule).updateEveryDayActive();
            }
            return;
        }

        /* internal  */onEveryDayActiveOptHandler(arg1: DataEvent): void
        {
            var e: DataEvent;
            var info: DailyInfo;
            var tips: string;
            var onCloseHandler: Function;

            var loc1;
            tips = null;
            e = arg1;
            info = e.data as DailyInfo;
            if (info) 
            {
                var loc2=info.type;
                switch (loc2) 
                {
                    case EDailyWelfare._EDailyWelfareAccLoadReward:
                    {
                        Dispatcher.dispatchEvent(new DataEvent(EventName.OpenTotalLoadModule));
                        break;
                    }
                    case EDailyWelfare._EDailyWelfareContinuousLoadReward: case EDailyWelfare._EDailyWelfareVipReward: case EDailyWelfare._EDailyWelfareOfflineExp: case EDailyWelfare._EDailyWelfareCopyExp:
                    {
                        Dispatcher.dispatchEvent(new DataEvent(EventName.DailyGiftOpen));
                        break;
                    }
                    case EDailyWelfare._EDailyWelfareCrossUniqueWORSHIP:
                    {
                        if (cache.crossMainCity.isInCrossMainCityActive) 
                        {
                            onCloseHandler = (arg1: int): void
                            {
                                var loc1=cache.scene.getNpcByEffect(ENpcEffect._ENpcEffectOpenWorshipView);
                                if (arg1 != Alert.OK) 
                                {
                                    if (arg1 == Alert.YES) 
                                    {
                                        AIManager.onAutoPathAIControl(loc1);
                                    }
                                }
                                else 
                                {
                                    AIManager.onAIControl(loc1, AIType.AI_Convey);
                                }
                                return;
                            }
                            Alert.okLabel = Language.getString(36359);
                            Alert.yesLabel = Language.getString(36360);
                            Alert.buttonWidth = 70;
                            Alert.showCloseBtn = true;
                            tips = Language.getString(36361);
                            if (GameMapUtil.curMapState.isCrossMainCity) 
                            {
                                Alert.show(tips, Language.getString(36362), Alert.YES | Alert.OK, null, onCloseHandler);
                            }
                            else 
                            {
                                Alert.show(tips, Language.getString(36362), Alert.OK, null, onCloseHandler);
                            }
                        }
                        else 
                        {
                            MsgManager.showRollTipsMsg(Language.getString(20978));
                        }
                        break;
                    }
                    case EDailyWelfare._EDailyWelfareCultureFightSpirit:
                    {
                        Dispatcher.dispatchEvent(new DataEvent(EventName.FightSpiritShowModule));
                        break;
                    }
                    case EDailyWelfare._EDailyWelfareExpDice:
                    {
                        Dispatcher.dispatchEvent(new DataEvent(EventName.ShowPlayDice));
                        break;
                    }
                    case EDailyWelfare._EDailyWelfareGuildReward:
                    {
                        Dispatcher.dispatchEvent(new DataEvent(EventName.OpenGuildWindow, 0));
                        break;
                    }
                    case EDailyWelfare._EDailyWelfareLearnGuildSkill:
                    {
                        Dispatcher.dispatchEvent(new DataEvent(EventName.OpenGuildWindow, 7));
                        break;
                    }
                    case EDailyWelfare._EDailyWelfareLotteryFreeRefresh:
                    {
                        Dispatcher.dispatchEvent(new DataEvent(EventName.OpenDramaLotteryModule));
                        break;
                    }
                    case EDailyWelfare._EDailyWelfarePetArena:
                    {
                        Dispatcher.dispatchEvent(new DataEvent(EventName.PetCpnOpenWindow));
                        break;
                    }
                    case EDailyWelfare._EDailyWelfarePetExplore:
                    {
                        Dispatcher.dispatchEvent(new DataEvent(EventName.PetExploreOpen));
                        break;
                    }
                    case EDailyWelfare._EDailyWelfarePetLifeStype:
                    {
                        Dispatcher.dispatchEvent(new DataEvent(EventName.PetMingJuWindowOpen));
                        break;
                    }
                    case EDailyWelfare._EDailyWelfareTreasureBowlReward:
                    {
                        Dispatcher.dispatchEvent(new DataEvent(EventName.CornucopiaShowView));
                        break;
                    }
                    case EDailyWelfare._EDailyWelfareWuXingDice:
                    {
                        Dispatcher.dispatchEvent(new DataEvent(EventName.WuXingWindowOpenReq));
                        break;
                    }
                    case EDailyWelfare._EDailyWelfareFlyGrowExchange:
                    {
                        Dispatcher.dispatchEvent(new DataEvent(EventName.FashionBoxModuleShowToTab, 3));
                        break;
                    }
                }
            }
            return;
        }

        /* internal  */onRoleNewEnergyUpdate(arg1: DataEvent): void
        {
            if (isViewShow) 
            {
                (_view as IDailyModule).onRoleNewEnergyUpdate();
            }
            return;
        }

        private /* var */_seriesLoginReward: ISeriesLoginRewardWindow;

        private /* var */_dailySwf: DailyIconSwf;
    }
